package com.yicong.ants.bean.order;

import com.yicong.ants.bean.scenic.ScenicItem;
import com.yicong.ants.manager.config.ZzConfigs;

import java.util.List;



/**
 * 购买历史 （二次消费，特惠景区）
 *
 * @author cchao
 * @version 2019-08-23.
 */

public class BillHistoryBean extends ScenicItem {
    String total_amount;
    String scenic_name;

    String project_id;
    String project_name;

    int category;
    String ordersn;
    String qr_code;
    String telephone;
    String desc;
    String pay_time;
    int num;
    int order_status;
    // 是否可以申述
    int can_appeal;
    String original_price;
    String actual_price;
    // 短信=sms  二维码=qr_code
    String ticket_type;
    double discount;

    String update_time;
    String create_time;
    String visit_date;
    String appeal_time;
    String appeal_reason;
    String appeal_result;
    List<VisitorsInfo> visitors;

    public BillHistoryBean() {
    }

    public String getQr_code() {
        return ZzConfigs.getApi() + "/api/v1/Order/ticket_qr_code?ordersn=" + getOrdersn();
    }

    public String getPayStatusBackup() {
        switch (order_status) {
            case 0:
                return "待支付";
            case 1:
                return "支付成功";
            case 2:
                return "支付失败";
            case 3:
                return "订单已完成";
            case 4:
            case 10:
                return "申述审核中";
            case 11:
                return "申述处理中";
            case 12:
                return "申诉成功";
            case 13:
                return "申诉驳回";
        }
        return "订单异常";
    }

    public String getPayStatus() {
        // 支付状态:0=待支付, 10=交易成功, 20=交易失败,30=订单已消费
        switch (order_status) {
            case 0:
                return "待支付";
            case 10:
                return "支付成功";
            case 20:
                return "支付失败";
            case 30:
                return "订单已完成";
            case 40:
            case 120:
                return "申述审核中";
            case 140:
                return "申诉成功";
            case 130:
                return "申诉驳回";
        }
        return "订单异常";
    }

    public String getTotal_amount() {
        return this.total_amount;
    }

    public String getScenic_name() {
        return this.scenic_name;
    }

    public String getProject_id() {
        return this.project_id;
    }

    public String getProject_name() {
        return this.project_name;
    }

    public int getCategory() {
        return this.category;
    }

    public String getOrdersn() {
        return this.ordersn;
    }

    public String getTelephone() {
        return this.telephone;
    }

    public String getDesc() {
        return this.desc;
    }

    public String getPay_time() {
        return this.pay_time;
    }

    public int getNum() {
        return this.num;
    }

    public int getOrder_status() {
        return this.order_status;
    }

    public int getCan_appeal() {
        return this.can_appeal;
    }

    public String getOriginal_price() {
        return this.original_price;
    }

    public String getActual_price() {
        return this.actual_price;
    }

    public String getTicket_type() {
        return this.ticket_type;
    }

    public double getDiscount() {
        return this.discount;
    }

    public String getUpdate_time() {
        return this.update_time;
    }

    public String getCreate_time() {
        return this.create_time;
    }

    public String getVisit_date() {
        return this.visit_date;
    }

    public String getAppeal_time() {
        return this.appeal_time;
    }

    public String getAppeal_reason() {
        return this.appeal_reason;
    }

    public String getAppeal_result() {
        return this.appeal_result;
    }

    public List<VisitorsInfo> getVisitors() {
        return this.visitors;
    }

    public BillHistoryBean setTotal_amount(String total_amount) {
        this.total_amount = total_amount;
        return this;
    }

    public BillHistoryBean setScenic_name(String scenic_name) {
        this.scenic_name = scenic_name;
        return this;
    }

    public BillHistoryBean setProject_id(String project_id) {
        this.project_id = project_id;
        return this;
    }

    public BillHistoryBean setProject_name(String project_name) {
        this.project_name = project_name;
        return this;
    }

    public BillHistoryBean setCategory(int category) {
        this.category = category;
        return this;
    }

    public BillHistoryBean setOrdersn(String ordersn) {
        this.ordersn = ordersn;
        return this;
    }

    public BillHistoryBean setQr_code(String qr_code) {
        this.qr_code = qr_code;
        return this;
    }

    public BillHistoryBean setTelephone(String telephone) {
        this.telephone = telephone;
        return this;
    }

    public BillHistoryBean setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public BillHistoryBean setPay_time(String pay_time) {
        this.pay_time = pay_time;
        return this;
    }

    public BillHistoryBean setNum(int num) {
        this.num = num;
        return this;
    }

    public BillHistoryBean setOrder_status(int order_status) {
        this.order_status = order_status;
        return this;
    }

    public BillHistoryBean setCan_appeal(int can_appeal) {
        this.can_appeal = can_appeal;
        return this;
    }

    public BillHistoryBean setOriginal_price(String original_price) {
        this.original_price = original_price;
        return this;
    }

    public BillHistoryBean setActual_price(String actual_price) {
        this.actual_price = actual_price;
        return this;
    }

    public BillHistoryBean setTicket_type(String ticket_type) {
        this.ticket_type = ticket_type;
        return this;
    }

    public BillHistoryBean setDiscount(double discount) {
        this.discount = discount;
        return this;
    }

    public BillHistoryBean setUpdate_time(String update_time) {
        this.update_time = update_time;
        return this;
    }

    public BillHistoryBean setCreate_time(String create_time) {
        this.create_time = create_time;
        return this;
    }

    public BillHistoryBean setVisit_date(String visit_date) {
        this.visit_date = visit_date;
        return this;
    }

    public BillHistoryBean setAppeal_time(String appeal_time) {
        this.appeal_time = appeal_time;
        return this;
    }

    public BillHistoryBean setAppeal_reason(String appeal_reason) {
        this.appeal_reason = appeal_reason;
        return this;
    }

    public BillHistoryBean setAppeal_result(String appeal_result) {
        this.appeal_result = appeal_result;
        return this;
    }

    public BillHistoryBean setVisitors(List<VisitorsInfo> visitors) {
        this.visitors = visitors;
        return this;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof BillHistoryBean)) return false;
        final BillHistoryBean other = (BillHistoryBean) o;
        if (!other.canEqual((Object) this)) return false;
        if (!super.equals(o)) return false;
        final Object this$total_amount = this.getTotal_amount();
        final Object other$total_amount = other.getTotal_amount();
        if (this$total_amount == null ? other$total_amount != null : !this$total_amount.equals(other$total_amount))
            return false;
        final Object this$scenic_name = this.getScenic_name();
        final Object other$scenic_name = other.getScenic_name();
        if (this$scenic_name == null ? other$scenic_name != null : !this$scenic_name.equals(other$scenic_name))
            return false;
        final Object this$project_id = this.getProject_id();
        final Object other$project_id = other.getProject_id();
        if (this$project_id == null ? other$project_id != null : !this$project_id.equals(other$project_id))
            return false;
        final Object this$project_name = this.getProject_name();
        final Object other$project_name = other.getProject_name();
        if (this$project_name == null ? other$project_name != null : !this$project_name.equals(other$project_name))
            return false;
        if (this.getCategory() != other.getCategory()) return false;
        final Object this$ordersn = this.getOrdersn();
        final Object other$ordersn = other.getOrdersn();
        if (this$ordersn == null ? other$ordersn != null : !this$ordersn.equals(other$ordersn))
            return false;
        final Object this$qr_code = this.getQr_code();
        final Object other$qr_code = other.getQr_code();
        if (this$qr_code == null ? other$qr_code != null : !this$qr_code.equals(other$qr_code))
            return false;
        final Object this$telephone = this.getTelephone();
        final Object other$telephone = other.getTelephone();
        if (this$telephone == null ? other$telephone != null : !this$telephone.equals(other$telephone))
            return false;
        final Object this$desc = this.getDesc();
        final Object other$desc = other.getDesc();
        if (this$desc == null ? other$desc != null : !this$desc.equals(other$desc)) return false;
        final Object this$pay_time = this.getPay_time();
        final Object other$pay_time = other.getPay_time();
        if (this$pay_time == null ? other$pay_time != null : !this$pay_time.equals(other$pay_time))
            return false;
        if (this.getNum() != other.getNum()) return false;
        if (this.getOrder_status() != other.getOrder_status()) return false;
        if (this.getCan_appeal() != other.getCan_appeal()) return false;
        final Object this$original_price = this.getOriginal_price();
        final Object other$original_price = other.getOriginal_price();
        if (this$original_price == null ? other$original_price != null : !this$original_price.equals(other$original_price))
            return false;
        final Object this$actual_price = this.getActual_price();
        final Object other$actual_price = other.getActual_price();
        if (this$actual_price == null ? other$actual_price != null : !this$actual_price.equals(other$actual_price))
            return false;
        final Object this$ticket_type = this.getTicket_type();
        final Object other$ticket_type = other.getTicket_type();
        if (this$ticket_type == null ? other$ticket_type != null : !this$ticket_type.equals(other$ticket_type))
            return false;
        if (Double.compare(this.getDiscount(), other.getDiscount()) != 0) return false;
        final Object this$update_time = this.getUpdate_time();
        final Object other$update_time = other.getUpdate_time();
        if (this$update_time == null ? other$update_time != null : !this$update_time.equals(other$update_time))
            return false;
        final Object this$create_time = this.getCreate_time();
        final Object other$create_time = other.getCreate_time();
        if (this$create_time == null ? other$create_time != null : !this$create_time.equals(other$create_time))
            return false;
        final Object this$visit_date = this.getVisit_date();
        final Object other$visit_date = other.getVisit_date();
        if (this$visit_date == null ? other$visit_date != null : !this$visit_date.equals(other$visit_date))
            return false;
        final Object this$appeal_time = this.getAppeal_time();
        final Object other$appeal_time = other.getAppeal_time();
        if (this$appeal_time == null ? other$appeal_time != null : !this$appeal_time.equals(other$appeal_time))
            return false;
        final Object this$appeal_reason = this.getAppeal_reason();
        final Object other$appeal_reason = other.getAppeal_reason();
        if (this$appeal_reason == null ? other$appeal_reason != null : !this$appeal_reason.equals(other$appeal_reason))
            return false;
        final Object this$appeal_result = this.getAppeal_result();
        final Object other$appeal_result = other.getAppeal_result();
        if (this$appeal_result == null ? other$appeal_result != null : !this$appeal_result.equals(other$appeal_result))
            return false;
        final Object this$visitors = this.getVisitors();
        final Object other$visitors = other.getVisitors();
        if (this$visitors == null ? other$visitors != null : !this$visitors.equals(other$visitors))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof BillHistoryBean;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final Object $total_amount = this.getTotal_amount();
        result = result * PRIME + ($total_amount == null ? 43 : $total_amount.hashCode());
        final Object $scenic_name = this.getScenic_name();
        result = result * PRIME + ($scenic_name == null ? 43 : $scenic_name.hashCode());
        final Object $project_id = this.getProject_id();
        result = result * PRIME + ($project_id == null ? 43 : $project_id.hashCode());
        final Object $project_name = this.getProject_name();
        result = result * PRIME + ($project_name == null ? 43 : $project_name.hashCode());
        result = result * PRIME + this.getCategory();
        final Object $ordersn = this.getOrdersn();
        result = result * PRIME + ($ordersn == null ? 43 : $ordersn.hashCode());
        final Object $qr_code = this.getQr_code();
        result = result * PRIME + ($qr_code == null ? 43 : $qr_code.hashCode());
        final Object $telephone = this.getTelephone();
        result = result * PRIME + ($telephone == null ? 43 : $telephone.hashCode());
        final Object $desc = this.getDesc();
        result = result * PRIME + ($desc == null ? 43 : $desc.hashCode());
        final Object $pay_time = this.getPay_time();
        result = result * PRIME + ($pay_time == null ? 43 : $pay_time.hashCode());
        result = result * PRIME + this.getNum();
        result = result * PRIME + this.getOrder_status();
        result = result * PRIME + this.getCan_appeal();
        final Object $original_price = this.getOriginal_price();
        result = result * PRIME + ($original_price == null ? 43 : $original_price.hashCode());
        final Object $actual_price = this.getActual_price();
        result = result * PRIME + ($actual_price == null ? 43 : $actual_price.hashCode());
        final Object $ticket_type = this.getTicket_type();
        result = result * PRIME + ($ticket_type == null ? 43 : $ticket_type.hashCode());
        final long $discount = Double.doubleToLongBits(this.getDiscount());
        result = result * PRIME + (int) ($discount >>> 32 ^ $discount);
        final Object $update_time = this.getUpdate_time();
        result = result * PRIME + ($update_time == null ? 43 : $update_time.hashCode());
        final Object $create_time = this.getCreate_time();
        result = result * PRIME + ($create_time == null ? 43 : $create_time.hashCode());
        final Object $visit_date = this.getVisit_date();
        result = result * PRIME + ($visit_date == null ? 43 : $visit_date.hashCode());
        final Object $appeal_time = this.getAppeal_time();
        result = result * PRIME + ($appeal_time == null ? 43 : $appeal_time.hashCode());
        final Object $appeal_reason = this.getAppeal_reason();
        result = result * PRIME + ($appeal_reason == null ? 43 : $appeal_reason.hashCode());
        final Object $appeal_result = this.getAppeal_result();
        result = result * PRIME + ($appeal_result == null ? 43 : $appeal_result.hashCode());
        final Object $visitors = this.getVisitors();
        result = result * PRIME + ($visitors == null ? 43 : $visitors.hashCode());
        return result;
    }

    public String toString() {
        return "BillHistoryBean(total_amount=" + this.getTotal_amount() + ", scenic_name=" + this.getScenic_name() + ", project_id=" + this.getProject_id() + ", project_name=" + this.getProject_name() + ", category=" + this.getCategory() + ", ordersn=" + this.getOrdersn() + ", qr_code=" + this.getQr_code() + ", telephone=" + this.getTelephone() + ", desc=" + this.getDesc() + ", pay_time=" + this.getPay_time() + ", num=" + this.getNum() + ", order_status=" + this.getOrder_status() + ", can_appeal=" + this.getCan_appeal() + ", original_price=" + this.getOriginal_price() + ", actual_price=" + this.getActual_price() + ", ticket_type=" + this.getTicket_type() + ", discount=" + this.getDiscount() + ", update_time=" + this.getUpdate_time() + ", create_time=" + this.getCreate_time() + ", visit_date=" + this.getVisit_date() + ", appeal_time=" + this.getAppeal_time() + ", appeal_reason=" + this.getAppeal_reason() + ", appeal_result=" + this.getAppeal_result() + ", visitors=" + this.getVisitors() + ")";
    }

    public static class VisitorsInfo{
        String name;
        String mobile;
        String id_number;

        public VisitorsInfo() {
        }

        public String getName() {
            return this.name;
        }

        public String getMobile() {
            return this.mobile;
        }

        public String getId_number() {
            return this.id_number;
        }

        public VisitorsInfo setName(String name) {
            this.name = name;
            return this;
        }

        public VisitorsInfo setMobile(String mobile) {
            this.mobile = mobile;
            return this;
        }

        public VisitorsInfo setId_number(String id_number) {
            this.id_number = id_number;
            return this;
        }

        public boolean equals(final Object o) {
            if (o == this) return true;
            if (!(o instanceof VisitorsInfo)) return false;
            final VisitorsInfo other = (VisitorsInfo) o;
            if (!other.canEqual((Object) this)) return false;
            final Object this$name = this.getName();
            final Object other$name = other.getName();
            if (this$name == null ? other$name != null : !this$name.equals(other$name))
                return false;
            final Object this$mobile = this.getMobile();
            final Object other$mobile = other.getMobile();
            if (this$mobile == null ? other$mobile != null : !this$mobile.equals(other$mobile))
                return false;
            final Object this$id_number = this.getId_number();
            final Object other$id_number = other.getId_number();
            if (this$id_number == null ? other$id_number != null : !this$id_number.equals(other$id_number))
                return false;
            return true;
        }

        protected boolean canEqual(final Object other) {
            return other instanceof VisitorsInfo;
        }

        public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            final Object $name = this.getName();
            result = result * PRIME + ($name == null ? 43 : $name.hashCode());
            final Object $mobile = this.getMobile();
            result = result * PRIME + ($mobile == null ? 43 : $mobile.hashCode());
            final Object $id_number = this.getId_number();
            result = result * PRIME + ($id_number == null ? 43 : $id_number.hashCode());
            return result;
        }

        public String toString() {
            return "BillHistoryBean.VisitorsInfo(name=" + this.getName() + ", mobile=" + this.getMobile() + ", id_number=" + this.getId_number() + ")";
        }
    }
}
